[% setvar title TITLE %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Here Docs Terminators (Was Whitespace and Here Docs)</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Richard Proctor &lt;<a href='mailto:richard@waveney.org'>richard@waveney.org</a>&gt;
  Date: 16 Aug 2000
  Last Modified: 2 Sep 2000
  Mailing List: <a href='mailto:perl6-language@perl.org'>perl6-language@perl.org</a>
  Number: 111
  Version: 3
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>With a here doc print &lt;&lt;ZZZ; the ZZZ has to be at the start of a line and the
text of the here doc, is processed verbatum.  This results in the terminator
sticking out in the body of the document, makes indenting blocks of text
difficult and causes errors and confusion.</p>
<p>There are several FAQs that relate to this problem.  This proposal tidies
this up.</p>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>Perl6 should ignore any whitespace before the terminator of a heredoc on any
line.  Further it should ignore any whitespace &quot;;&quot;s (and comments) that
follow the terminator.  Perl should also ignore whitespace between the &lt;&lt; and
the terminator.</p>
<p>Discussion took place on allowing statements following the terminator, but
generally these where thought of as a bad idea.  So only &quot;;&quot; and comments
should occour on the same line.</p>
<pre>      All of these should work:
      
      print &lt;&lt;EOL;
EOL
      print &lt;&lt; EOL;
   EOL
      print &lt;&lt; EOL;
   EOL;
      print &lt;&lt; EOL
   EOL;
      print &lt;&lt;EOL ;
EOL     # this is the end of the here doc
      print &lt;&lt;EOL
EOL;    # this is the end of the here doc
      print &lt;&lt;EOL ;
EOL;    # this is the end of the here doc

      But this should be an error:
      
      print &lt;&lt;EOL
      EOL; $i++;</pre>
<a name='IMPLENTATION'></a><h1>IMPLENTATION</h1>
<p>This should be a relatively simple addition to perl
(I think just to scan_heredoc in toke.c + docs in perl5)</p>
<a name='CHANGES'></a><h1>CHANGES</h1>
<p>RFC111 V1 Had two concepts, one about the terminator and another about the
content.  This has been split into two concepts, this RFC and RFC 162.</p>
<p>RFC111 V2 Just had the termination issue, and # commets after the
terminator</p>
<p>RFC111 V3 Adds the &quot;;&quot; as acceptable after the terminator (and more examples)</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>RFC162    Filtering Heredocs (was originally part of RFC 111 V1)</p>
</div>
